home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 5.6 KB | 182 lines |
- '***************************
- '* AMOS Professional *
- '* *
- '* AMAL_4 * Amal control
- '* *
- '* (c) Europress Software *
- '* *
- '* Ronnie Simpson *
- '***************************
- '
- '-------------------------------------------
- 'Channel
- '-------------------------------------------
- 'assign an amal channel
- '
- 'As a default all Amal channels are assigned to the relevant sprite numbers,
- 'the Channel command allows channel numbers to be referenced to control
- 'various other activities:-
- '
- 'Assign a channel to control a bob
- '
- ' Channel 1 To Bob 5 (assign channel 1 to bob 5)
- '
- 'Assign a channel to control Screen Display
- '
- ' Channel 2 To Screen Display 0 (assign channel 1 to screen 0)
- '
- ' X and Y registers hold screen hardware coordinates
- '
- 'Assign a channel to control Screen Offset
- '
- ' Channel 8 To Screen Offset 1 (assign channel 8 to screen 1)
- '
- ' X and Y registers hold screen offset position
- '
- 'Assign a channel to control Screen size
- '
- ' Channel 2 To Screen Size 0 (assign channel 2 to screen 0)
- '
- ' X and Y registers hold width and height sizes
- '
- 'Assign a channel to control a Rainbow
- '
- ' Channel 8 To Rainbow 1 (assign channel 8 to rainbow 1)
- '
- ' X holds rainbow base (change this to rotate colours)
- ' Y holds start position (change this to bounce rainbow)
- ' A holds rainbow Height (measured in scan lines)
- '
- '-------------------------------------------
- 'Amal Freeze
- '-------------------------------------------
- 'freeze 1 or all amal channels
- '
- 'Used without parameters Amal Freeze will halt all existing Amal programs, if
- 'the channel number is added then only that channel will be frozen.
- '
- ' Amal Freeze 3 (halt only channel number 3)
- ' Amal Freeze (halt all Amal programs)
- '
- 'A call to Amal On will restart your programs.
- '
- '-------------------------------------------
- 'Amal Off
- '-------------------------------------------
- 'Stop 1 or all Amal programs
- '
- 'Used without parameters Amal Off will stop all existing Amal programs, if
- 'the channel number is added then only that channel will be stopped.This
- 'instruction erases the program from memory and would have to be re-defined
- 'before it can be used again.
- '
- ' Amal Off 5 (delete only channel number 5)
- ' Amal Off (delete all Amal programs)
- '
- '
- '-------------------------------------------
- 'Update every
- '-------------------------------------------
- 'Slow down Amal programs
- '
- 'Each Amal program is stepped through each 1/50th. of a second if a large
- 'number of objects or large sized graphics are being handled then this amount
- 'of time may not be enough for the updating to take place. The Update Every
- 'instruction compensates for this by delaying the update process in steps
- 'of 1/50th. of a second.
- '
- 'eg. Update Every 2 (update every 2 Vbls.)
- '
- 'Please note that more processor time will now be availiable for your Basic
- 'programs.
- '
- '-------------------------------------------
- 'Channan
- '-------------------------------------------
- 'test an Amal animation
- '
- 'This function tests the Amal animation of any channel and Returns either
- '-1 (true) if the sequence is active or 0 (false if it is not.
- '
- ' A=Chanan(2) (check anim status of channel 2)
- ' While Chanan(8) : Wend (wait for animation to be completed)
- '
- '-------------------------------------------
- 'Chanmv
- '-------------------------------------------
- 'test an Amal Move sequence
- '
- 'Similar to the above Chanan but checks the Amal channel for the status of
- 'object movement, Returns either -1 (true) if the sequence is still being
- 'moved or 0 (false) if movement is complete.
- '
- ' M=Chanmv(4)
- ' If Not Chanmv(9) Then Amal 9,A$ : Amal On 9
- '
- '-------------------------------------------
- 'Amalerr
- '-------------------------------------------
- 'error position in string
- '
- 'As an aid to de-bugging your Amal strings, Amalerr returns the position of
- 'the error (Measured in characters). If an error occurs in your Amal program
- 'go to direct mode and type:-
- '
- ' Print Mid$(A$,Amalerr,10)
- ' |
- ' +--->enter name of your Amal string
- '
- 'This will print out the 10 characters following the error and hopefully
- 'pinpoint your mistakes easily.
- '-------------------------------------------
- 'EXAMPLE
- '-------------------------------------------
- Rem *** tidy up screen and grab a sprite
- '
- Colour Back $3
- Screen Open 0,320,256,4,Lowres : Flash Off
- Palette $3,$FFF,$77,$FF4 : Curs Off : Cls 0 : Hide
- For N=0 To 3 : For C=0 To 3 : Colour N*4+C+16, Colour(C) : Next : Next
- Paper 0 : Pen 1 : Print "." : Get Sprite 1,0,0 To 7,7
- Cls 0
- '
- Rem *** define rainbow to be animated with amal
- '
- Set Rainbow 0,0,200,"(3,-1,15)","","(1,1,15)"
- Rainbow 0,0,50,200
- A$="Loop: For R0=1 To 150; Let X=R0;Let Y=R0*2;Let A=R0;Next R0;"
- A$=A$+"For R0=1 To 150; Let X=150-R0;Let Y=300-R0;Let A=150-R0;Next R0;"
- A$=A$+"Pause Jump Loop"
- Channel 15 To Rainbow 0
- Amal 15,A$
- Amal On 15
- '
- Rem *** define amal program to control starfield
- '
- B$="Loop:Let X=280;Let Y=140;Let R0=Z(6)-3;Let R1=Z(6)-3;"
- B$=B$+"For R9=1 To 40;Let X=X+R0;LY=Y+R1;Next R9;"
- B$=B$+"Pause Jump Loop"
- '
- Rem *** assign 15 channels to the starfield
- '
- For N=0 To 14
- Sprite N,0,0,1
- Amal N,B$
- Wait 10
- Amal On N
- Next
- '
- Rem *** plot some stars
- '
- Ink 2
- For N=1 To 150
- Plot Rnd(320),Rnd(256)
- Wait 5
- Next
- '
- Rem *** wait for mouse key to end
- '
- Pen 3 : Locate 0,22 : Centre "Press any mouse key to quit"
- Do
- If Mouse Key Then Direct
- Loop